package asia.lxq.cic.controller;


import asia.lxq.cic.entity.Appeal;
import asia.lxq.cic.entity.Result;
import asia.lxq.cic.service.AppealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/appeal")
public class AppealController {

    @Autowired
    AppealService appealService;

    @GetMapping("/appeal_list")
    public Result<Object> getAppealList(){
        return appealService.getAppealList();
    }

    @PostMapping("/appeal_scope")
    public Result<Object> scopeAppeal(@RequestBody Appeal appeal){
        return appealService.scopeAppeal(appeal);
    }

    @PostMapping("/appeal_write")
    public Result<Object> writeAppeal(@RequestBody Appeal appeal, Authentication authentication){
        return appealService.addAppeal(appeal,authentication);
    }
}
